package com.ct.sales.view;

import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.ext.SatelliteMenu;
import android.view.ext.SatelliteMenuItem;
import android.widget.TabHost;
import com.ct.sales.R;
import com.ct.sales.view.widget.CustomHeaderFragment;
import com.up91.common.android.BaseActivity;
import com.up91.common.android.helper.L;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends BaseActivity {
    @Override
    protected void onBaseCreate(Bundle savedInstanceState) {
        setContentView(R.layout.main);
    }

    @Override
    protected void initViews() {
        TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost);
        tabHost.setup();

        tabHost.addTab(tabHost.newTabSpec("home").setIndicator(getString(R.string.main_tab_home)).setContent(R.id.fg_home));
        tabHost.addTab(tabHost.newTabSpec("demo").setIndicator("demo").setContent(R.id.fg_demo));
        tabHost.addTab(tabHost.newTabSpec("raid").setIndicator("团队").setContent(R.id.fg_raid));
        tabHost.addTab(tabHost.newTabSpec("demo2").setIndicator("demo2").setContent(R.id.fg_demo2));

        final SatelliteMenu menu = (SatelliteMenu) findViewById(R.id.menu);

        List<SatelliteMenuItem> items = new ArrayList<SatelliteMenuItem>();
        items.add(new SatelliteMenuItem(1, R.drawable.ic_path_menu_item_1));
        items.add(new SatelliteMenuItem(2, R.drawable.ic_path_menu_item_2));
        items.add(new SatelliteMenuItem(3, R.drawable.ic_path_menu_item_3));
        menu.addItems(items);

        menu.setOnItemClickedListener(new SatelliteMenu.SateliteClickedListener() {
            public void eventOccured(int id) {
                L.i("sat", "Clicked on " + id);
            }
        });
    }
}
